function h = speclegend(varargin)

% find object excluded from legend and made them invisible for the standard legend maker
kids = findall(gca);
toTrig = isappdata(kids,'notInLegend');
hvstat = get(kids(toTrig),'handleVisibility');
set(kids(toTrig),'handleVisibility','off');

% call standard legend maker
h = legend(varargin{:});

% revert handle visibility back
set(kids(toTrig),{'handleVisibility'},hvstat);

end